<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>测试定位</title>
    <style>
        .box{
            background-color: deeppink;
            position: absolute;
            /* 定位，脱流，丢失宽度 */
            left: 0;
            right: 0;
            width: 200px;
            margin: auto;
        }
    </style>
</head>
<body>
    <div class="box">
        这是一个盒子
    </div>
</body>
</html>